<?php
  require_once('tpl/header.php');
?>
<?php 
   require_once("loginCheckadmin.php");
   require_once("../system/dbConn.php");
   
  //接受userlist传递的uid参数，连接数据库写sql语句去删除用户记录


	$gid=$_GET["gid"];
  $sql2="select * from 0goods where gid=$gid";
  $result2 = mysqli_query($link,$sql2);
//结果集
  $row = mysqli_fetch_assoc($result2);

  $sql1="insert into goods values(null,'$row[gname]','$row[type]','$row[price]','$row[pic]','$row[time]','$row[uploaduser]','$row[detial]','$row[phone]',0)";
   // echo $sql;
    $result1=mysqli_query($link,$sql1);
//整数
  if ($result1==0){

  
      echo "添加失败";
   }

   



    
   


    //svar_dump($uid);
    $sql="delete from 0goods where gid=$gid";
    $result=mysql_query($sql);//整数
    if($result ==1){
    	echo "上架成功";
    	header("refresh:3;url='0shopList.php'");
    }else{
    	echo "上架失败";
    }
   

	 ?>
   


<?php
  require_once('tpl/footer.php');
?>